<!DOCTYPE html>
<html>
  <head>
    <title><%= title %></title>
    <link rel='stylesheet' href='/stylesheets/style.css' />
  </head>
  <body>
    <button id="btn">请求列表数据</button>
  </body>
  <script>
    let btn = document.querySelector('#btn')

    btn.onclick = function () {
        fetch('http://localhost:3000/getdata',{
            headers:{
                Authorization:localStorage['token']
            }
        }).then(res => res.json())
        .then(res => {
            console.log(res)
        })
    }
  </script>
</html>
